home *** CD-ROM | disk | FTP | other *** search
/ Java Developer's Companion / Java Developer's Companion.iso / Javacup / INGZP26A.TAR / internet / INGZP26A / TitlePanel.java < prev    next >
Encoding:
Java Source  |  1996-05-21  |  910 b   |  45 lines

  1. /* $Id: TitlePanel.java,v 1.2 1996/03/28 08:48:06 djun Exp $
  2.  
  3.    File: TitlePanel.java
  4.  
  5.    Author: Djun M. Kim
  6.    Copyright (c) 1996 Djun M. Kim.  All rights reserved.
  7.  
  8. */
  9.  
  10. import java.awt.*;
  11. import AboutPopup;
  12.  
  13. public class TitlePanel extends Panel {
  14.  
  15.     private MapInfo parent;
  16.  
  17.     private AboutPopup infoframe;
  18.     private Button title_button;
  19.     private String title_string;
  20.  
  21.     TitlePanel(MapInfo target) {           
  22.         this.parent = target;        // get our parent
  23.     setLayout(new GridLayout(1,1));    
  24.     title_string = parent.map.getTitle();
  25.     title_button = new Button("MapInfo - "+title_string);
  26.     add(title_button);
  27.     infoframe = new AboutPopup(target);
  28.     }
  29.  
  30.    public boolean action(Event evt, Object arg) {
  31.  
  32.     if (evt.target instanceof Button) {
  33.         Button b = (Button)evt.target;
  34.         if (b == title_button) {
  35.         if (!infoframe.isShowing())
  36.             infoframe.show();
  37.         }
  38.     }
  39.     return true;
  40.    }
  41.  
  42. }
  43.  
  44.  
  45.